using ASP;
using System;
using System.Configuration;
using System.Data.Common;
using System.Data.SqlClient;
using System.Globalization;
using System.Threading;
using System.Web.Profile;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;

public partial class FilterClient : Page, IRequiresSessionState
{
    private string selected = null;

    protected void gvwResult_SelectedIndexChanged(object sender, EventArgs e)
    {
        string Result = this.gvwResult.DataKeys[this.gvwResult.SelectedIndex]["Client"].ToString();
        if (this.Session["SelectedClient"] != null)
        {
            this.Session["SelectedClient"] = Result;
        }
        else
        {
            this.Session.Add("SelectedClient", Result);
        }
        string scriptStr = "<script>window.close();</script>";
        base.ClientScript.RegisterClientScriptBlock(typeof(string), "closing", scriptStr);
    }

    protected override void InitializeCulture()
    {
        string sCulture = ConfigurationManager.AppSettings["DefaultCulture"].ToString();
        try
        {
            sCulture = this.Session["Culture"].ToString();
        }
        catch (NullReferenceException)
        {
        }
        Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(sCulture);
        Thread.CurrentThread.CurrentUICulture = new CultureInfo(sCulture);
        base.InitializeCulture();
    }

    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton1.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton10_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton10.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton11_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton11.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton12_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton12.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton13_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton13.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton14_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton14.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton15_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton15.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton16_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton16.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton17_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton17.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton18_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton18.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton19_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton19.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton2_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton2.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton20_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton20.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton21_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton21.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton22_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton22.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton23_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton23.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton24_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton24.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton25_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton25.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton26_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton26.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton27_Click(object sender, EventArgs e)
    {
        this.selected = string.Empty;
        this.gvwResult.DataBind();
    }

    protected void LinkButton3_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton3.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton4_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton4.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton5_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton5.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton6_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton6.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton7_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton7.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton8_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton8.Text;
        this.gvwResult.DataBind();
    }

    protected void LinkButton9_Click(object sender, EventArgs e)
    {
        this.selected = this.LinkButton9.Text;
        this.gvwResult.DataBind();
    }

    protected void odsResult_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
    {
        SqlParameter[] sqlparam = new SqlParameter[4];
        sqlparam[0] = new SqlParameter();
        sqlparam[0].ParameterName = "@Client";
        sqlparam[0].Value = "";
        sqlparam[1] = new SqlParameter();
        sqlparam[1].ParameterName = "@Name";
        sqlparam[1].Value = this.selected;
        sqlparam[2] = new SqlParameter();
        sqlparam[2].ParameterName = "@ChineseName";
        sqlparam[2].Value = "";
        sqlparam[3] = new SqlParameter();
        sqlparam[3].ParameterName = "@ContactPerson";
        sqlparam[3].Value = "";
        DbParameter[] param = sqlparam;
        e.InputParameters[0] = "_IPMS_ClientSelect_SP";
        e.InputParameters[1] = param;
    }

    protected void Page_Load(object sender, EventArgs e)
    {
    }

}
